package org.dinner.order.service.impl;

import java.util.List;

import org.dinner.order.dao.RoleDAO;
import org.dinner.order.model.Role;
import org.dinner.order.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleDAO roleDAO;
	
	@Transactional
	public Role add(Role item) {
		return roleDAO.add(item);
	}

	@Transactional
	public List<Role> list() {
		return roleDAO.list();
	}

	@Transactional
	public Role getById(int id) {
		return roleDAO.getById(id);
	}

	@Transactional
	public void remove(int id) {
		roleDAO.remove(id);
	}

	@Transactional
	public Role getByName(String role) {
		return roleDAO.getByName(role);
	}

}
